package com.situ.mall.web.controller;

import com.situ.mall.common.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
//订单地址页面
@Controller
@RequestMapping("/")
public class ConfirmController {

    @Autowired
    private ICartService cartService;
    @PostMapping("/confirm-order")
    public String confirm(String ids, Model model){

        //获取购物车ID
        model.addAttribute("ids",ids);
        //获取商品数据
        model.addAttribute("cartList",cartService.selectProducts(ids));
        //获会员地址数据
        model.addAttribute("addressList",cartService.selectAddress());

        return "confirm-order";
    }
}
